CC = gcc

COMPOPT = -g -Wall -DLINUX

CFLAGS = $(COMPOPT) -I/usr/include/lua5.1/

LDFLAGS = `sdl-config --libs` -ldl -lGL -lglut -lm -lode -llua5.1

OBJS = main.o configuration.o loutre.o world.o robot.o maths.o compteur.o object.o sensor.o 

SOURCE = .

EXEC = main

all: $(OBJS)
	$(CC) $(OBJS) $(COMPOPT) $(LDFLAGS) -o $(EXEC);
	./upversion.pl > /tmp/loutre; mv /tmp/loutre ./version.h

%.o:$(SOURCE)/%.cpp $(SOURCE)/%.h $(SOURCE)/configuration.h $(SOURCE)/placements.h $(SOURCE)/keys.h $(SOURCE)/version.h
	$(CC) $(CFLAGS) $< -c -o $@

%.o:$(SOURCE)/%.cpp
	$(CC) $(CFLAGS) $< -c -o $@


clean:
	rm -f $(OBJS) $(SOURCE)/*~ $(SOURCE)/\#*\# $(EXEC)

distclean:
	rm -f $(OBJS) $(SOURCE)/*~ $(SOURCE)/\#*\#
